python get digits of number

27

import math
digits = int(math.log10(n))+1
num = 123456
print(len(str(num)))

Comments

Submit
0 Comments